#! /bin/bash
pid=`ps -ef | grep 'java -jar /root/.jenkins/workspace/helloadmin/hello-admin/target/hello-admin-0.0.1-SNAPSHOT.jar'| grep -v grep|awk '{print $2}'`
if [ -n "$pid" ]
then
   echo "kill -9 的pid:" $pid
   kill -9 $pid
fi
echo "$pid"
nohup java -jar ./helloadmin/hello-admin/target/hello-admin-0.0.1-SNAPSHOT.jar /dev/null 2>&1 &
echo "可以用了 已经启动java了"
